{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\bww\\AppData\\Local\\Temp\\ipykernel_9244\\1339045006.py:1: DeprecationWarning: \n",
      "Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),\n",
      "(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)\n",
      "but was not found to be installed on your system.\n",
      "If this would cause problems for you,\n",
      "please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466\n",
      "        \n",
      "  import pandas as pd\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "from bokeh.plotting import figure, show, output_notebook\n",
    "# %matplotlib inline 是一个 Jupyter Notebook 的魔法命令\n",
    "# 使得 matplotlib 绘制的图形可以直接在 Notebook 的输出单元格中显示。这个命令特别适合于数据分析和可视化的交互式环境。\n",
    "%matplotlib inline\n",
    "\n",
    "df=pd.read_csv(\"csv\\\\children.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index(['x', 'y', 'y1', 'y2'], dtype='object')\n"
     ]
    }
   ],
   "source": [
    "# 显示所有列名  \n",
    "print(df.columns)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bokeh.layouts import row\n",
    "from bokeh.plotting import figure, show\n",
    "x = df[\"x\"].values[0:10]\n",
    "y1 = df[\"y\"].values[0:10]\n",
    "y2 = df[\"y1\"].values[0:10]\n",
    "y3 = df[\"y2\"].values[0:10]\n",
    "# create three plots with one renderer each\n",
    "s1 = figure(width=250, height=250, background_fill_color=\"#fafafa\")\n",
    "s1.circle(x, y1, size=12, color=\"#53777a\", alpha=0.8)\n",
    "s2 = figure(width=250, height=250, background_fill_color=\"#fafafa\")\n",
    "s2.triangle(x, y2, size=12, color=\"#c02942\", alpha=0.8)\n",
    "s3 = figure(width=250, height=250, background_fill_color=\"#fafafa\")\n",
    "s3.square(x, y3, size=12, color=\"#d95b43\", alpha=0.8)\n",
    "# put the results in a row that adjusts accordingly\n",
    "show(row(children=[s1, s2, s3], sizing_mode=\"scale_width\"))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
